import { reqCategoryList, reqGetBannerList,reqFloorList } from "../../api";
const state = {
    categoryList: [],
    getBannerList:[],
    getFloorList:[]
};
const mutations = {
    CATEGORYLIST(state, categoryList) {
        state.categoryList = categoryList;
    },
    GETBANNERLIST(state,getBannerList){
        state.getBannerList = getBannerList;
    },
    GETFLOORLIST(state,getFloorList){
        state.getFloorList = getFloorList;
    },
};
const actions = {
    async categoryList({ commit }) {
        let { data } = await reqCategoryList();
        if (data.code == 200) {
            commit("CATEGORYLIST", data);
            // console.log(data);
        }
    },
    async getBannerList({commit}) {
        let { data } = await reqGetBannerList();
        if (data.code == 200) {
            commit("GETBANNERLIST", data);
        }
    },
    async getFloorList({commit}) {
        let { data } = await reqFloorList();
        if (data.code == 200) {
            commit("GETFLOORLIST", data);
        }
    },
};
const getters = {};
export default {
    state,
    mutations,
    actions,
    getters,
};
